﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WordAddin
{
    public partial class VerifySignatureFrm : DevComponents.DotNetBar.Office2007Form
    {
        public string InputFilePath { get; set; }
        public string SigFilePath { get; set; }

        public VerifySignatureFrm()
        {
            InitializeComponent();
        }

        private void tbsignfile_TextChanged(object sender, EventArgs e)
        {

        }

        private void btnBrowsefile_Click(object sender, EventArgs e)
        {
            openFileDialog1.Title = "Select your file";
            openFileDialog1.FileName = string.Empty;
            openFileDialog1.Filter = "word 2003 Files (*.doc)|*.doc|" +
                                        "word 2007/2010 Files (*.docx)|*.docx";
            openFileDialog1.Multiselect = false;
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                tbfile.Text = openFileDialog1.FileName;
            }
        }

        private void btnBrowseSignFile_Click(object sender, EventArgs e)
        {
            openFileDialog1.Title = "Select your signed file";
            openFileDialog1.FileName = string.Empty;

            openFileDialog1.Filter = "Signed file (*.sig) | *.sig";
            openFileDialog1.Multiselect = false;
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                tbsignfile.Text = openFileDialog1.FileName;
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            InputFilePath = tbfile.Text;
            SigFilePath = tbsignfile.Text;

            DialogResult = DialogResult.OK;
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}
